# 保存文件上传-校验
module.exports.saveValid =
  # 校验规则
  rules:
    file_upload:
      file_name: 'String|max:128'
      rename_file_name: 'String|max:128'
      file_type: 'String|max:32'
      file_size: 'String|max:32'
      file_path: 'String|max:256'
      file_url: 'String|max:256'

  # 错误提示
  errorTips:
    file_upload:
      file_name:
        string:'文件名字须由组成'
        max:'文件名字超过128字符'
      rename_file_name:
        string:'文件名字须由组成'
        max:'文件名字超过128字符'
      file_type:
        string:'文件类型须由组成'
        max:'文件类型超过32字符'
      file_size:
        string:'文件大小须由组成'
        max:'文件大小超过32字符'
      file_path:
        string:'文件地址须由组成'
        max:'文件地址超过256字符'
      file_url:
        string:'访问路径须由组成'
        max:'访问路径超过256字符'

# 删除文件上传-校验
module.exports.removeValid =
  # 校验规则
  rules:
    file_upload_ids: 'required|array' 

  # 错误提示
  errorTips:
    file_upload_ids:
      required: '请输入文件上传ID'
      alpha_num: '文件上传ID必须是数组' 

# 查询文件上传-校验
module.exports.queryValid =
  # 校验规则
  rules:
    pageNum: 'digits_between:1,16'
    pageSize: 'digits_between:1,16'

  # 错误提示
  errorTips:
    pageNum:
      digits_between: '当前页号必须为1到16位数字'
    pageSize:
      digits_between: '每页记录数必须为1到16位数字'

# 查询多个文件上传-校验
module.exports.querySomeValid =
  # 校验规则
  rules:
    file_upload_ids: 'required|array' 

  # 错误提示
  errorTips:
    file_upload_ids:
      required: '请输入文件上传ID数组'
      array: '必须是文件上传ID数组' 

# 查询单个文件上传-校验 
module.exports.findByIdValid =
  # 校验规则
  rules:
    file_upload_id: 'required|alpha_num|max:32' 

  # 错误提示
  errorTips:
    file_upload_id:
      required: '请输入文件上传ID'
      alpha_num: '文件上传ID必须是字母或数字'
      max: '文件上传ID长度不能超过32' 

# 修改文件上传-校验
module.exports.updateValid =
  # 校验规则
  rules:
    file_upload:
      file_upload_id: 'required|alpha_num|max:32'
      file_name: 'String|max:128'
      rename_file_name: 'String|max:128'
      file_type: 'String|max:32'
      file_size: 'String|max:32'
      file_path: 'String|max:256'
      file_url: 'String|max:256'

  # 错误提示
  errorTips:
    file_upload:
      file_upload_id:
        required: '请输入文件上传ID'
        alpha_num: '文件上传ID必须是字母或数字'
        max: '文件上传ID长度不能超过32'
      file_name:
        string:'文件名字须由组成'
        max:'文件名字超过128字符'
      rename_file_name:
        string:'文件名字须由组成'
        max:'文件名字超过128字符'
      file_type:
        string:'文件类型须由组成'
        max:'文件类型超过32字符'
      file_size:
        string:'文件大小须由组成'
        max:'文件大小超过32字符'
      file_path:
        string:'文件地址须由组成'
        max:'文件地址超过256字符'
      file_url:
        string:'访问路径须由组成'
        max:'访问路径超过256字符'